home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 April / EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso / classx / util / xfa_util / arexx / adpro_animtoxfa_zoom.rexx next >
OS/2 REXX Batch file  |  1998-03-09  |  5KB  |  110 lines

  1. /*
  2. ** Anim To XFA REQ ZOOM - ADPro Arexx Script Converter
  3. **
  4. ** This code shows how to open a File Requester
  5. ** For setting Input Anim Name and Output Anim Name.
  6. **
  7. ** ADPro could also be used for creating great effects.
  8. ** Here we will perform a "zooming" effect.
  9. **
  10. ** This code (C)Copyright Fabio Rotondo.
  11. ** It is given as Freeware example and may not be used
  12. ** for any commercial product.
  13. **
  14. */
  15.  
  16. ADDRESS "XFA.1"                 /* Let's ADDRESS XFA */
  17. CountFormat ""
  18. SetPath ADPro "ADPro:ADPro"     /* Set ADPro Path    */
  19. CallProcessor ADPro             /* Call ADPro        */
  20.  
  21. ADDRESS "ADPro"       /* Let's ADDRESS ADPro          */
  22. LFORMAT "ANIM"        /* InputFile is an ANIM File    */
  23. SFORMAT "IFF"         /* We have to save it as an IFF */
  24. INTERFACE_SIZE TINY
  25. OPTIONS RESULTS
  26.  
  27. sparename = "T:Frame" /* Name of file to be processed */
  28.  
  29. /* Here we ask for an Anim File name for input */
  30. GETFILE '"Select An Anim File To Convert"'
  31. IF RC = 10 THEN abort()  /* If user press cancel, we abort the script */
  32. animname = ADPRO_RESULT  /* We store ANIM file name into animname     */
  33.  
  34. /* Here we ask for a Output XFA Anim File Name for output */
  35. GETFILE '"Save XFA Anim as..."'
  36. IF RC = 10 THEN exit    /* Same as Above...*/
  37. outname = ADPRO_RESULT
  38.  
  39. frames = 0                            /* Number of frames of the Anim */
  40. LOAD animname COUNT                   /* Let's count the Anim Frames */
  41. frames = ADPRO_RESULT-2               /* frames = ADPro's Result     */
  42.  
  43. LOAD animname FRAME 1                 /* Now we load the 1st Frame    */
  44. EXECUTE                               /* We render it into ADPro      */
  45. PSTATUS LOCKED                        /* And Lock The Palette next    */
  46.                                       /* Frames will be remapped is   */
  47.                                       /* We need it. (Multi pal anims)*/
  48.  
  49. SAVE sparename||0 IMAGE               /* Save it into T:Frame0        */
  50.  
  51.  
  52. ADDRESS "XFA.1"          /* Now we call XFA (port is XFA.1)    */
  53. FirstFrame 0             /* We Set FirstFrame to 0             */
  54. LastFrame frames         /* We Set LastFrame to Anim Frames    */
  55. Compression 32I          /* Set Compression to  32I            */
  56. CloseAnim LOOP           /* Set AnimClose Mode to  LOOP        */
  57. InputName sparename      /* Input Root Name is T:Frame         */
  58. OutputName outname       /* XFA Animation Name will be T:a.xfa */
  59. SetProcessor ADPro       /* We Select ImageProcessor Program   */
  60. InitXFA                  /* XFA Initialization                 */
  61.                          /* NOTE: BEFORE call InitXFA you have */
  62.                          /* To perform AT LEAST all settings   */
  63.                          /* We have done inside this example.  */
  64.                          /* Also remember of having the FIRST  */
  65.                          /* Frame of the ANIM saved as IFF, for*/
  66.                          /* Configuring correctly XFA          */
  67.  
  68. zoomdelta = 100/frames   /* Here we calculate the difference from */
  69.                          /* One frame to another. The Effect will */
  70.                          /* Be a zoom from 0% to 100% image size. */
  71.  
  72. zoomval = zoomdelta
  73.  
  74. DO t=1 TO frames-1                      /* For t=1 TO NFrames... */
  75.     ADDRESS "ADPro"                     /* Call ADPro            */
  76.     LOAD animname FRAME t               /* Load Frame N          */
  77.     PCT_SCALE zoomval zoomval           /* The Zoom!!!           */
  78.     zoomval = zoomval + zoomdelta       /* Next Frame Will Be Larger */
  79.  
  80.     EXECUTE                             /* Render It             */
  81.     x = t-1
  82.     n = sparename||x
  83.     SAVE n  IMAGE                       /* Save Picture          */
  84.  
  85.     ADDRESS "XFA.1"                     /* Call XFA              */
  86.     GetFrame (t-1)                      /* Load This Frame       */
  87.     PutFrame                            /* Put It Inside Anim    */
  88. END                                     /* Next                  */
  89. ADDRESS "ADPro"                     /* Call ADPro            */
  90. LOAD animname FRAME frames          /* Load The LAST Frame   */
  91. EXECUTE                             /* Render It             */
  92. x = frames-1
  93. n = sparename||x
  94. SAVE n  IMAGE                       /* Save Picture          */
  95.  
  96. ADDRESS "XFA.1"                     /* Call XFA              */
  97. GetFrame (t-1)                      /* Load This Frame       */
  98. PutFrame                            /* Put It Inside Anim    */
  99.  
  100.  
  101. CloseXFA                                /* Here We Close XFA Anim*/
  102.  
  103. Message '"Conversion done."'
  104. exit                                    /* End Of Arexx Script!! */
  105.  
  106. abort:
  107.     ADDRESS "XFA.1"
  108.     Message '"Operation Aborted By The User."'
  109.     exit(0)
  110.